package com.itheima.map;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author 王加鑫
 * @Date 2021/5/16 15:33
 * @Version 1.0
 */
public class MapDemo02 {
    public static void main(String[] args) {
        Map<String, String> map = new HashMap<>();

        map.put("郭靖", "黄蓉");
        map.put("杨过", "小龙女");
        map.put("张无忌", "周芷若");
        System.out.println(map);

        map.put("张无忌", "赵敏");
        System.out.println(map);

        map.remove("杨过");
        System.out.println(map);

        map.containsKey("张无忌");
        System.out.println(map);

        System.out.println(map.containsKey("尹志平"));

        System.out.println(map.containsValue("灭绝师太"));

        System.out.println(map.size());

        System.out.println(map.isEmpty());

        map.clear();

        System.out.println(map.isEmpty());


    }
}
